*Appendix Figure 2

cd "/Users/kevin/Dropbox/TZ ITNs"
set more off
set varabbrev off

use "constructed data/for_analysis.dta", clear

cd "/Users/kevin/Dropbox/TZ ITNs/plots"


  forvalues i=30(15)90 {
reg village_chair post i.zone if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}


coefplot (period_30, label("30 days")) (period_45, label("45 days")) (period_60, label("60 days")) ///
(period_75, label("75 days")) (period_90, label("90 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("VC approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "30" .834 "45" 1 "60" 1.166 "75" 1.332 "90") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_vc_fade_bw_zone.gph", replace

forvalues i=30(15)90 {
reg village_exec post i.zone if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_30, label("30 days")) (period_45, label("45 days")) (period_60, label("60 days")) ///
(period_75, label("75 days")) (period_90, label("90 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("VEO approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "30" .834 "45" 1 "60" 1.166 "75" 1.332 "90") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_veo_fade_bw_zone.gph", replace

forvalues i=30(15)90 {
reg councillor post i.zone if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_30, label("30 days")) (period_45, label("45 days")) (period_60, label("60 days")) ///
(period_75, label("75 days")) (period_90, label("90 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("Councillor approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "30" .834 "45" 1 "60" 1.166 "75" 1.332 "90") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_councillor_fade_bw_zone.gph", replace

forvalues i=30(15)90 {
reg ward_exec post i.zone if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_30, label("30 days")) (period_45, label("45 days")) (period_60, label("60 days")) ///
(period_75, label("75 days")) (period_90, label("90 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("WEO approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "30" .834 "45" 1 "60" 1.166 "75" 1.332 "90") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_weo_fade_bw_zone.gph", replace

forvalues i=30(15)90 {
reg mp post i.zone if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_30, label("30 days")) (period_45, label("45 days")) (period_60, label("60 days")) ///
(period_75, label("75 days")) (period_90, label("90 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("MP approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "30" .834 "45" 1 "60" 1.166 "75" 1.332 "90") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_mp_fade_bw_zone.gph", replace

graph combine "binary_vc_fade_bw_zone.gph" "binary_veo_fade_bw_zone.gph" "binary_councillor_fade_bw_zone.gph" "binary_weo_fade_bw_zone.gph" ///
"binary_mp_fade_bw_zone.gph", ///
  rows(2) cols(3) subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  // saving(all_officials_fade.pdf), replace

  
